package com.taobao.txc.common.a;

import com.taobao.txc.common.LoggerWrap;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

class e
{
  private String b;
  private FileOutputStream c;
  
  public e(b paramb, String paramString)
  {
    this.b = paramString;
  }
  
  public void a(byte[] paramArrayOfByte)
  {
    if (this.c == null)
    {
      File localFile1 = new File(this.b);
      File localFile2 = localFile1.getParentFile();
      if (!localFile2.exists()) {
        localFile2.mkdirs();
      }
      if (!localFile1.exists()) {
        try
        {
          localFile1.createNewFile();
        }
        catch (IOException localIOException2)
        {
          b.a().a(null, "failed to create analyze index file " + this.b, localIOException2);
          return;
        }
      }
      try
      {
        this.c = new FileOutputStream(localFile1, true);
      }
      catch (FileNotFoundException localFileNotFoundException)
      {
        return;
      }
    }
    try
    {
      this.c.write(paramArrayOfByte);
    }
    catch (IOException localIOException1)
    {
      b.a().a(null, "failed to write", localIOException1);
    }
  }
  
  public void a()
  {
    if (this.c != null) {
      try
      {
        this.c.close();
      }
      catch (IOException localIOException) {}
    }
  }
}


/* Location:           C:\Users\ibm\Downloads\txc-yun-sample (1)\txc-yun-sample\lib\txc-client-2.0.72.jar
 * Qualified Name:     com.taobao.txc.common.a.e
 * JD-Core Version:    0.7.0.1
 */